<?php

namespace catchAdmin\basics\controller;

use catcher\base\CatchRequest as Request;
use catcher\CatchResponse;
use catcher\base\CatchController;
use catchAdmin\basics\model\Part as PartModel;
use catcher\CatchAuth;
use think\Response;

class Part extends CatchController
{
    
    protected $partModel;

    /**
     *
     * @time 2022/03/04 14:16
     * @param PartModel $routeModel
     * @return mixed
     */
    public function __construct(PartModel $partModel)
    {
        $this->partModel = $partModel;
    }

//    /**
//     *
//     * @time 2022/02/15 11:41
//     * @throws \think\db\exception\DbException
//     * @return \think\response\Json
//     */
//    public function index(CatchAuth $auth)
//    {
//        $user = $auth->user();
//        return CatchResponse::paginate($this->partModel->getList($user['tenant_id']));
//    }
//
//    /**
//     *
//     * @time 2022/02/28 14:25
//     * @throws \think\db\exception\DbException
//     * @return \think\response\Json
//     */
//    public function create(CatchAuth $auth,Request $request)
//    {
//        $params = $request->filterEmptyField()->post();
//        $user = $auth->user();
//        $params['tenant_id'] = $user['tenant_id'];
//        return CatchResponse::success($this->partModel->storeBy($params),"新建成功");
//    }
//
//    /**
//     *
//     * @time 2022/02/28 14:25
//     * @throws \think\db\exception\DbException
//     * @return \think\response\Json
//     */
//    public function update(Request $request)
//    {
//        $params = $request->filterEmptyField()->post();
//        return CatchResponse::success($this->partModel->updateBy($params['id'], $params),"修改成功");
//    }
//
//    /**
//     * 删除
//     * @time 2022/02/28 15:16
//     * @param Request $request
//     * @return \think\response\Json
//     */
//    public function delete(Request $request)
//    {
//        $id = $request->post('id');
//        return CatchResponse::success($this->partModel->deleteBy($id),'删除成功');
//    }
}